#ifndef GPIO_HPP
#define GPIO_HPP
#include <stdint.h>
#include <stdbool.h>
#include "hc32_ddl.h"

namespace device
{
	class gpio
	{
		public:
			
			typedef enum
			{
				GPIO_PORT_A = 0,
				GPIO_PORT_B,
				GPIO_PORT_C,
				GPIO_PORT_D,
				GPIO_PORT_E,
				GPIO_PORT_H,
			}GpioPortTPDF;
			
			typedef struct
			{
				GpioPortTPDF GpioPort;
				uint8_t GpioPin;
			}GpioPinTPDF;
			
			static void Write(GpioPortTPDF tGpioPort, uint8_t ucPin, uint8_t ucStatus);
			static void Modify(GpioPortTPDF tGpioPort, uint32_t uiMask, uint32_t uiData);
			static void Toggle(GpioPortTPDF tGpioPort, uint8_t ucPin);
			static uint8_t Read(GpioPortTPDF tGpioPort, uint8_t ucPin);
			static uint32_t Read(GpioPortTPDF tGpioPort);
			static void SetOutputMode(GpioPortTPDF tGpioPort, uint8_t ucPin, bool bPushPull);
			static void SetInputMode(GpioPortTPDF tGpioPort, uint8_t ucPin, bool bPullUp, bool bPullDown);
	};
}

#endif
